package org.apache.james.mime4j.field.mimeversion;

import java.io.IOException;
import java.io.PrintStream;

public class MimeVersionParserTokenManager
  implements MimeVersionParserConstants
{
  static final long[] jjbitVec0;
  public static final int[] jjnewLexState;
  static final int[] jjnextStates;
  public static final String[] jjstrLiteralImages;
  static final long[] jjtoMore;
  static final long[] jjtoSkip;
  static final long[] jjtoSpecial;
  static final long[] jjtoToken;
  public static final String[] lexStateNames;
  int commentNest;
  protected char curChar;
  int curLexState;
  public PrintStream debugStream;
  int defaultLexState;
  StringBuffer image;
  protected SimpleCharStream input_stream;
  int jjimageLen;
  int jjmatchedKind;
  int jjmatchedPos;
  int jjnewStateCnt;
  int jjround;
  private final int[] jjrounds;
  private final int[] jjstateSet;
  int lengthOfMatch;

  static
  {
    long[] arrayOfLong1 = new long[4];
    arrayOfLong1[0] = 0L;
    arrayOfLong1[1] = 0L;
    arrayOfLong1[2] = -1L;
    arrayOfLong1[3] = -1L;
    jjbitVec0 = arrayOfLong1;
    jjnextStates = new int[0];
    String[] arrayOfString1 = new String[21];
    arrayOfString1[0] = "";
    arrayOfString1[1] = "\r";
    arrayOfString1[2] = "\n";
    arrayOfString1[3] = null;
    arrayOfString1[4] = null;
    arrayOfString1[5] = null;
    arrayOfString1[6] = null;
    arrayOfString1[7] = null;
    arrayOfString1[8] = null;
    arrayOfString1[9] = null;
    arrayOfString1[10] = null;
    arrayOfString1[11] = null;
    arrayOfString1[12] = null;
    arrayOfString1[13] = null;
    arrayOfString1[14] = null;
    arrayOfString1[15] = null;
    arrayOfString1[16] = null;
    arrayOfString1[17] = null;
    arrayOfString1[18] = ".";
    arrayOfString1[19] = null;
    arrayOfString1[20] = null;
    jjstrLiteralImages = arrayOfString1;
    String[] arrayOfString2 = new String[4];
    arrayOfString2[0] = "DEFAULT";
    arrayOfString2[1] = "INCOMMENT";
    arrayOfString2[2] = "NESTED_COMMENT";
    arrayOfString2[3] = "INQUOTEDSTRING";
    lexStateNames = arrayOfString2;
    int[] arrayOfInt = new int[21];
    arrayOfInt[0] = -1;
    arrayOfInt[1] = -1;
    arrayOfInt[2] = -1;
    arrayOfInt[3] = -1;
    arrayOfInt[4] = 1;
    arrayOfInt[5] = 0;
    arrayOfInt[6] = -1;
    arrayOfInt[7] = 2;
    arrayOfInt[8] = -1;
    arrayOfInt[9] = -1;
    arrayOfInt[10] = -1;
    arrayOfInt[11] = -1;
    arrayOfInt[12] = -1;
    arrayOfInt[13] = 3;
    arrayOfInt[14] = -1;
    arrayOfInt[15] = -1;
    arrayOfInt[16] = 0;
    arrayOfInt[17] = -1;
    arrayOfInt[18] = -1;
    arrayOfInt[19] = -1;
    arrayOfInt[20] = -1;
    jjnewLexState = arrayOfInt;
    long[] arrayOfLong2 = new long[1];
    arrayOfLong2[0] = 458759L;
    jjtoToken = arrayOfLong2;
    long[] arrayOfLong3 = new long[1];
    arrayOfLong3[0] = 40L;
    jjtoSkip = arrayOfLong3;
    long[] arrayOfLong4 = new long[1];
    arrayOfLong4[0] = 8L;
    jjtoSpecial = arrayOfLong4;
    long[] arrayOfLong5 = new long[1];
    arrayOfLong5[0] = 65488L;
    jjtoMore = arrayOfLong5;
  }

  public MimeVersionParserTokenManager(SimpleCharStream paramSimpleCharStream)
  {
    this.debugStream = System.out;
    this.jjrounds = new int[3];
    this.jjstateSet = new int[6];
    this.curLexState = 0;
    this.defaultLexState = 0;
    this.input_stream = paramSimpleCharStream;
  }

  public MimeVersionParserTokenManager(SimpleCharStream paramSimpleCharStream, int paramInt)
  {
    this(paramSimpleCharStream);
    SwitchTo(paramInt);
  }

  private final void ReInitRounds()
  {
    this.jjround = -2147483647;
    int i = 3;
    while (true)
    {
      int j = i - 1;
      if (i <= 0)
        return;
      this.jjrounds[j] = -2147483648;
      i = j;
    }
  }

  private final void jjAddStates(int paramInt1, int paramInt2)
  {
    while (true)
    {
      int[] arrayOfInt = this.jjstateSet;
      int i = this.jjnewStateCnt;
      this.jjnewStateCnt = (i + 1);
      arrayOfInt[i] = jjnextStates[paramInt1];
      int j = paramInt1 + 1;
      if (paramInt1 == paramInt2)
        return;
      paramInt1 = j;
    }
  }

  private final void jjCheckNAdd(int paramInt)
  {
    if (this.jjrounds[paramInt] != this.jjround)
    {
      int[] arrayOfInt = this.jjstateSet;
      int i = this.jjnewStateCnt;
      this.jjnewStateCnt = (i + 1);
      arrayOfInt[i] = paramInt;
      this.jjrounds[paramInt] = this.jjround;
    }
  }

  private final void jjCheckNAddStates(int paramInt)
  {
    jjCheckNAdd(jjnextStates[paramInt]);
    jjCheckNAdd(jjnextStates[(paramInt + 1)]);
  }

  private final void jjCheckNAddStates(int paramInt1, int paramInt2)
  {
    while (true)
    {
      jjCheckNAdd(jjnextStates[paramInt1]);
      int i = paramInt1 + 1;
      if (paramInt1 == paramInt2)
        return;
      paramInt1 = i;
    }
  }

  private final void jjCheckNAddTwoStates(int paramInt1, int paramInt2)
  {
    jjCheckNAdd(paramInt1);
    jjCheckNAdd(paramInt2);
  }

  private final int jjMoveNfa_0(int paramInt1, int paramInt2)
  {
    long l1;
    int i = 0;
    this.jjnewStateCnt = 2;
    int j = 1;
    this.jjstateSet[0] = paramInt1;
    int k = 2147483647;
    int l = 1 + this.jjround;
    this.jjround = l;
    if (l == 2147483647)
      ReInitRounds();
    if (this.curChar < '@')
    {
      l1 = 1L << this.curChar;
      do
      {
        int[] arrayOfInt3 = this.jjstateSet;
        switch (???[(--j)])
        {
        default:
        case 2:
        case 0:
        case 1:
        }
      }
      while (j != i);
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          do
            while (true)
            {
              do
                while (true)
                {
                  do
                    while (true)
                    {
                      if (k != 2147483647)
                      {
                        this.jjmatchedKind = k;
                        this.jjmatchedPos = paramInt2;
                        k = 2147483647;
                      }
                      ++paramInt2;
                      j = this.jjnewStateCnt;
                      this.jjnewStateCnt = i;
                      i = 2 - i;
                      if (j != i)
                        break label351;
                      label156: return paramInt2;
                      if ((0x0 & l1) == 0L)
                        break;
                      if (k > 17)
                        k = 17;
                      jjCheckNAdd(1);
                    }
                  while ((0x2600 & l1) == 0L);
                  if (k > 3)
                    k = 3;
                  jjCheckNAdd(0);
                }
              while ((0x2600 & l1) == 0L);
              k = 3;
              jjCheckNAdd(0);
            }
          while ((0x0 & l1) == 0L);
          k = 17;
          jjCheckNAdd(1);
        }
        if (this.curChar >= 128)
          break;
        (1L << (0x3F & this.curChar));
        do
        {
          int[] arrayOfInt2 = this.jjstateSet;
          ???[(--j)];
        }
        while (j != i);
      }
      ((0xFF & this.curChar) >> '\6');
      (1L << (0x3F & this.curChar));
      do
      {
        int[] arrayOfInt1 = this.jjstateSet;
        ???[(--j)];
      }
      while (j != i);
    }
    try
    {
      label351: this.curChar = this.input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      break label156:
    }
  }

  private final int jjMoveNfa_1(int paramInt1, int paramInt2)
  {
    int i = 0;
    this.jjnewStateCnt = 3;
    int j = 1;
    this.jjstateSet[0] = paramInt1;
    int k = 2147483647;
    int l = 1 + this.jjround;
    this.jjround = l;
    if (l == 2147483647)
      ReInitRounds();
    if (this.curChar < '@')
    {
      (1L << this.curChar);
      int[] arrayOfInt4 = this.jjstateSet;
      switch (???[(--j)])
      {
      default:
      case 0:
      case 1:
      }
      while (true)
      {
        do
          while (true)
          {
            do
            {
              if (j != i);
              if (k != 2147483647)
              {
                this.jjmatchedKind = k;
                this.jjmatchedPos = paramInt2;
                k = 2147483647;
              }
              ++paramInt2;
              j = this.jjnewStateCnt;
              this.jjnewStateCnt = i;
              i = 3 - i;
              if (j != i)
                break label457;
              label152: return paramInt2;
            }
            while (k <= 8);
            k = 8;
          }
        while (k <= 6);
        k = 6;
      }
    }
    if (this.curChar < 128)
    {
      (1L << (0x3F & this.curChar));
      int[] arrayOfInt2 = this.jjstateSet;
      switch (???[(--j)])
      {
      default:
      case 0:
      case 1:
      case 2:
      }
      while (true)
      {
        do
          while (true)
          {
            do
              while (true)
              {
                do
                {
                  while (true)
                    if (j != i);
                  if (k > 8)
                    k = 8;
                }
                while (this.curChar != '\\');
                int[] arrayOfInt3 = this.jjstateSet;
                int i2 = this.jjnewStateCnt;
                this.jjnewStateCnt = (i2 + 1);
                arrayOfInt3[i2] = 1;
              }
            while (k <= 6);
            k = 6;
          }
        while (k <= 8);
        k = 8;
      }
    }
    int i1 = (0xFF & this.curChar) >> '\6';
    long l1 = 1L << (0x3F & this.curChar);
    int[] arrayOfInt1 = this.jjstateSet;
    switch (???[(--j)])
    {
    default:
    case 0:
    case 1:
    }
    while (true)
    {
      do
        while (true)
        {
          do
            while (true)
              if (j != i);
          while (((l1 & jjbitVec0[i1]) == 0L) || (k <= 8));
          k = 8;
        }
      while (((l1 & jjbitVec0[i1]) == 0L) || (k <= 6));
      k = 6;
    }
    try
    {
      label457: this.curChar = this.input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      break label152:
    }
  }

  private final int jjMoveNfa_2(int paramInt1, int paramInt2)
  {
    int i = 0;
    this.jjnewStateCnt = 3;
    int j = 1;
    this.jjstateSet[0] = paramInt1;
    int k = 2147483647;
    int l = 1 + this.jjround;
    this.jjround = l;
    if (l == 2147483647)
      ReInitRounds();
    if (this.curChar < '@')
    {
      (1L << this.curChar);
      int[] arrayOfInt4 = this.jjstateSet;
      switch (???[(--j)])
      {
      default:
      case 0:
      case 1:
      }
      while (true)
      {
        do
          while (true)
          {
            do
            {
              if (j != i);
              if (k != 2147483647)
              {
                this.jjmatchedKind = k;
                this.jjmatchedPos = paramInt2;
                k = 2147483647;
              }
              ++paramInt2;
              j = this.jjnewStateCnt;
              this.jjnewStateCnt = i;
              i = 3 - i;
              if (j != i)
                break label457;
              label152: return paramInt2;
            }
            while (k <= 12);
            k = 12;
          }
        while (k <= 9);
        k = 9;
      }
    }
    if (this.curChar < 128)
    {
      (1L << (0x3F & this.curChar));
      int[] arrayOfInt2 = this.jjstateSet;
      switch (???[(--j)])
      {
      default:
      case 0:
      case 1:
      case 2:
      }
      while (true)
      {
        do
          while (true)
          {
            do
              while (true)
              {
                do
                {
                  while (true)
                    if (j != i);
                  if (k > 12)
                    k = 12;
                }
                while (this.curChar != '\\');
                int[] arrayOfInt3 = this.jjstateSet;
                int i2 = this.jjnewStateCnt;
                this.jjnewStateCnt = (i2 + 1);
                arrayOfInt3[i2] = 1;
              }
            while (k <= 9);
            k = 9;
          }
        while (k <= 12);
        k = 12;
      }
    }
    int i1 = (0xFF & this.curChar) >> '\6';
    long l1 = 1L << (0x3F & this.curChar);
    int[] arrayOfInt1 = this.jjstateSet;
    switch (???[(--j)])
    {
    default:
    case 0:
    case 1:
    }
    while (true)
    {
      do
        while (true)
        {
          do
            while (true)
              if (j != i);
          while (((l1 & jjbitVec0[i1]) == 0L) || (k <= 12));
          k = 12;
        }
      while (((l1 & jjbitVec0[i1]) == 0L) || (k <= 9));
      k = 9;
    }
    try
    {
      label457: this.curChar = this.input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      break label152:
    }
  }

  private final int jjMoveNfa_3(int paramInt1, int paramInt2)
  {
    int i = 0;
    this.jjnewStateCnt = 3;
    int j = 1;
    this.jjstateSet[0] = paramInt1;
    int k = 2147483647;
    int l = 1 + this.jjround;
    this.jjround = l;
    if (l == 2147483647)
      ReInitRounds();
    if (this.curChar < '@')
    {
      long l3 = 1L << this.curChar;
      int[] arrayOfInt4 = this.jjstateSet;
      switch (???[(--j)])
      {
      default:
      case 0:
      case 2:
      case 1:
      }
      while (true)
      {
        do
          while (true)
          {
            do
            {
              if (j != i);
              if (k != 2147483647)
              {
                this.jjmatchedKind = k;
                this.jjmatchedPos = paramInt2;
                k = 2147483647;
              }
              ++paramInt2;
              j = this.jjnewStateCnt;
              this.jjnewStateCnt = i;
              i = 3 - i;
              if (j != i)
                break label518;
              label156: return paramInt2;
            }
            while ((0xFFFFFFFF & l3) == 0L);
            if (k > 15)
              k = 15;
            jjCheckNAdd(2);
          }
        while (k <= 14);
        k = 14;
      }
    }
    if (this.curChar < 128)
    {
      long l2 = 1L << (0x3F & this.curChar);
      int[] arrayOfInt2 = this.jjstateSet;
      switch (???[(--j)])
      {
      default:
      case 0:
      case 1:
      case 2:
      }
      while (true)
      {
        do
          while (true)
          {
            do
              while (true)
              {
                do
                  while (true)
                  {
                    while (true)
                      if (j != i);
                    if ((0xEFFFFFFF & l2) == 0L)
                      break;
                    if (k > 15)
                      k = 15;
                    jjCheckNAdd(2);
                  }
                while (this.curChar != '\\');
                int[] arrayOfInt3 = this.jjstateSet;
                int i2 = this.jjnewStateCnt;
                this.jjnewStateCnt = (i2 + 1);
                arrayOfInt3[i2] = 1;
              }
            while (k <= 14);
            k = 14;
          }
        while ((0xEFFFFFFF & l2) == 0L);
        if (k > 15)
          k = 15;
        jjCheckNAdd(2);
      }
    }
    int i1 = (0xFF & this.curChar) >> '\6';
    long l1 = 1L << (0x3F & this.curChar);
    int[] arrayOfInt1 = this.jjstateSet;
    switch (???[(--j)])
    {
    default:
    case 0:
    case 2:
    case 1:
    }
    while (true)
    {
      do
        while (true)
        {
          do
            while (true)
              if (j != i);
          while ((l1 & jjbitVec0[i1]) == 0L);
          if (k > 15)
            k = 15;
          jjCheckNAdd(2);
        }
      while (((l1 & jjbitVec0[i1]) == 0L) || (k <= 14));
      k = 14;
    }
    try
    {
      label518: this.curChar = this.input_stream.readChar();
    }
    catch (IOException localIOException)
    {
      break label156:
    }
  }

  private final int jjMoveStringLiteralDfa0_0()
  {
    int i;
    switch (this.curChar)
    {
    default:
      i = jjMoveNfa_0(2, 0);
    case '\n':
    case '\r':
    case '"':
    case '(':
    case '.':
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              return i;
              i = jjStartNfaWithStates_0(0, 2, 0);
            }
            i = jjStartNfaWithStates_0(0, 1, 0);
          }
          i = jjStopAtPos(0, 13);
        }
        i = jjStopAtPos(0, 4);
      }
      i = jjStopAtPos(0, 18);
    }
  }

  private final int jjMoveStringLiteralDfa0_1()
  {
    int i;
    switch (this.curChar)
    {
    default:
      i = jjMoveNfa_1(0, 0);
    case '(':
    case ')':
    }
    while (true)
    {
      while (true)
      {
        return i;
        i = jjStopAtPos(0, 7);
      }
      i = jjStopAtPos(0, 5);
    }
  }

  private final int jjMoveStringLiteralDfa0_2()
  {
    int i;
    switch (this.curChar)
    {
    default:
      i = jjMoveNfa_2(0, 0);
    case '(':
    case ')':
    }
    while (true)
    {
      while (true)
      {
        return i;
        i = jjStopAtPos(0, 10);
      }
      i = jjStopAtPos(0, 11);
    }
  }

  private final int jjMoveStringLiteralDfa0_3()
  {
    int i;
    switch (this.curChar)
    {
    default:
      i = jjMoveNfa_3(0, 0);
    case '"':
    }
    while (true)
    {
      return i;
      i = jjStopAtPos(0, 16);
    }
  }

  private final int jjStartNfaWithStates_0(int paramInt1, int paramInt2, int paramInt3)
  {
    int i;
    this.jjmatchedKind = paramInt2;
    this.jjmatchedPos = paramInt1;
    try
    {
      this.curChar = this.input_stream.readChar();
      i = jjMoveNfa_0(paramInt3, paramInt1 + 1);
      return i;
    }
    catch (IOException localIOException)
    {
      i = paramInt1 + 1;
    }
  }

  private final int jjStartNfaWithStates_1(int paramInt1, int paramInt2, int paramInt3)
  {
    int i;
    this.jjmatchedKind = paramInt2;
    this.jjmatchedPos = paramInt1;
    try
    {
      this.curChar = this.input_stream.readChar();
      i = jjMoveNfa_1(paramInt3, paramInt1 + 1);
      return i;
    }
    catch (IOException localIOException)
    {
      i = paramInt1 + 1;
    }
  }

  private final int jjStartNfaWithStates_2(int paramInt1, int paramInt2, int paramInt3)
  {
    int i;
    this.jjmatchedKind = paramInt2;
    this.jjmatchedPos = paramInt1;
    try
    {
      this.curChar = this.input_stream.readChar();
      i = jjMoveNfa_2(paramInt3, paramInt1 + 1);
      return i;
    }
    catch (IOException localIOException)
    {
      i = paramInt1 + 1;
    }
  }

  private final int jjStartNfaWithStates_3(int paramInt1, int paramInt2, int paramInt3)
  {
    int i;
    this.jjmatchedKind = paramInt2;
    this.jjmatchedPos = paramInt1;
    try
    {
      this.curChar = this.input_stream.readChar();
      i = jjMoveNfa_3(paramInt3, paramInt1 + 1);
      return i;
    }
    catch (IOException localIOException)
    {
      i = paramInt1 + 1;
    }
  }

  private final int jjStartNfa_0(int paramInt, long paramLong)
  {
    return jjMoveNfa_0(jjStopStringLiteralDfa_0(paramInt, paramLong), paramInt + 1);
  }

  private final int jjStartNfa_1(int paramInt, long paramLong)
  {
    return jjMoveNfa_1(jjStopStringLiteralDfa_1(paramInt, paramLong), paramInt + 1);
  }

  private final int jjStartNfa_2(int paramInt, long paramLong)
  {
    return jjMoveNfa_2(jjStopStringLiteralDfa_2(paramInt, paramLong), paramInt + 1);
  }

  private final int jjStartNfa_3(int paramInt, long paramLong)
  {
    return jjMoveNfa_3(jjStopStringLiteralDfa_3(paramInt, paramLong), paramInt + 1);
  }

  private final int jjStopAtPos(int paramInt1, int paramInt2)
  {
    this.jjmatchedKind = paramInt2;
    this.jjmatchedPos = paramInt1;
    return (paramInt1 + 1);
  }

  private final int jjStopStringLiteralDfa_0(int paramInt, long paramLong)
  {
    return -1;
  }

  private final int jjStopStringLiteralDfa_1(int paramInt, long paramLong)
  {
    return -1;
  }

  private final int jjStopStringLiteralDfa_2(int paramInt, long paramLong)
  {
    return -1;
  }

  private final int jjStopStringLiteralDfa_3(int paramInt, long paramLong)
  {
    return -1;
  }

  void MoreLexicalActions()
  {
    int i = this.jjimageLen;
    int j = 1 + this.jjmatchedPos;
    this.lengthOfMatch = j;
    this.jjimageLen = (i + j);
    switch (this.jjmatchedKind)
    {
    case 8:
    case 12:
    default:
    case 6:
    case 7:
    case 9:
    case 10:
    case 11:
    case 13:
    case 14:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          do
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    return;
                    if (this.image == null)
                      this.image = new StringBuffer();
                    this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
                    this.jjimageLen = 0;
                    this.image.deleteCharAt(this.image.length() - 2);
                  }
                  if (this.image == null)
                    this.image = new StringBuffer();
                  this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
                  this.jjimageLen = 0;
                  this.commentNest = 1;
                }
                if (this.image == null)
                  this.image = new StringBuffer();
                this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
                this.jjimageLen = 0;
                this.image.deleteCharAt(this.image.length() - 2);
              }
              if (this.image == null)
                this.image = new StringBuffer();
              this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
              this.jjimageLen = 0;
              this.commentNest = (1 + this.commentNest);
            }
            if (this.image == null)
              this.image = new StringBuffer();
            this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
            this.jjimageLen = 0;
            this.commentNest -= 1;
          }
          while (this.commentNest != 0);
          SwitchTo(1);
        }
        if (this.image == null)
          this.image = new StringBuffer();
        this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
        this.jjimageLen = 0;
        this.image.deleteCharAt(this.image.length() - 1);
      }
      if (this.image == null)
        this.image = new StringBuffer();
      this.image.append(this.input_stream.GetSuffix(this.jjimageLen));
      this.jjimageLen = 0;
      this.image.deleteCharAt(this.image.length() - 2);
    }
  }

  public void ReInit(SimpleCharStream paramSimpleCharStream)
  {
    this.jjnewStateCnt = 0;
    this.jjmatchedPos = 0;
    this.curLexState = this.defaultLexState;
    this.input_stream = paramSimpleCharStream;
    ReInitRounds();
  }

  public void ReInit(SimpleCharStream paramSimpleCharStream, int paramInt)
  {
    ReInit(paramSimpleCharStream);
    SwitchTo(paramInt);
  }

  public void SwitchTo(int paramInt)
  {
    if ((paramInt >= 4) || (paramInt < 0))
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + paramInt + ". State unchanged.", 2);
    this.curLexState = paramInt;
  }

  void TokenLexicalActions(Token paramToken)
  {
    switch (this.jjmatchedKind)
    {
    default:
    case 16:
    }
    while (true)
    {
      return;
      if (this.image == null)
        this.image = new StringBuffer();
      StringBuffer localStringBuffer = this.image;
      SimpleCharStream localSimpleCharStream = this.input_stream;
      int i = this.jjimageLen;
      int j = 1 + this.jjmatchedPos;
      this.lengthOfMatch = j;
      localStringBuffer.append(localSimpleCharStream.GetSuffix(i + j));
      paramToken.image = this.image.substring(0, this.image.length() - 1);
    }
  }

  public Token getNextToken()
  {
    Object localObject1 = null;
    int i = 0;
    try
    {
      this.curChar = this.input_stream.BeginToken();
      this.image = null;
      this.jjimageLen = 0;
      label575: label581: label364: switch (this.curLexState)
      {
      default:
        if (this.jjmatchedKind != 2147483647)
        {
          if (1 + this.jjmatchedPos < i)
            this.input_stream.backup(i - this.jjmatchedPos - 1);
          if ((jjtoToken[(this.jjmatchedKind >> 6)] & 1L << (0x3F & this.jjmatchedKind)) != 0L)
          {
            Token localToken3 = jjFillToken();
            localToken3.specialToken = localObject1;
            TokenLexicalActions(localToken3);
            if (jjnewLexState[this.jjmatchedKind] != -1)
              this.curLexState = jjnewLexState[this.jjmatchedKind];
            localObject2 = localToken3;
            return localObject2;
          }
        }
      case 0:
      case 1:
      case 2:
      case 3:
      }
    }
    catch (IOException localIOException1)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                this.jjmatchedKind = 0;
                Token localToken1 = jjFillToken();
                localToken1.specialToken = localObject1;
                Object localObject2 = localToken1;
              }
              this.jjmatchedKind = 2147483647;
              this.jjmatchedPos = 0;
              i = jjMoveStringLiteralDfa0_0();
            }
            this.jjmatchedKind = 2147483647;
            this.jjmatchedPos = 0;
            i = jjMoveStringLiteralDfa0_1();
          }
          this.jjmatchedKind = 2147483647;
          this.jjmatchedPos = 0;
          i = jjMoveStringLiteralDfa0_2();
        }
        this.jjmatchedKind = 2147483647;
        this.jjmatchedPos = 0;
        i = jjMoveStringLiteralDfa0_3();
      }
      if ((jjtoSkip[(this.jjmatchedKind >> 6)] & 1L << (0x3F & this.jjmatchedKind)) != 0L)
      {
        Token localToken2;
        if ((jjtoSpecial[(this.jjmatchedKind >> 6)] & 1L << (0x3F & this.jjmatchedKind)) != 0L)
        {
          localToken2 = jjFillToken();
          if (localObject1 != null)
            break label364;
          localObject1 = localToken2;
        }
        while (true)
        {
          while (true)
          {
            if (jjnewLexState[this.jjmatchedKind] == -1);
            this.curLexState = jjnewLexState[this.jjmatchedKind];
          }
          localToken2.specialToken = localObject1;
          localObject1.next = localToken2;
          localObject1 = localToken2;
        }
      }
      MoreLexicalActions();
      if (jjnewLexState[this.jjmatchedKind] != -1)
        this.curLexState = jjnewLexState[this.jjmatchedKind];
      i = 0;
      this.jjmatchedKind = 2147483647;
      try
      {
        this.curChar = this.input_stream.readChar();
      }
      catch (IOException localIOException3)
      {
        int j = this.input_stream.getEndLine();
        int k = this.input_stream.getEndColumn();
        String str = null;
        boolean bool = false;
        try
        {
          this.input_stream.readChar();
          this.input_stream.backup(1);
          if (!(bool))
          {
            this.input_stream.backup(1);
            if (i > 1)
              break label581;
            str = "";
          }
          throw new TokenMgrError(bool, this.curLexState, j, k, str, this.curChar, 0);
        }
        catch (IOException localIOException2)
        {
          while (true)
          {
            bool = true;
            if (i <= 1)
              str = "";
            while (true)
            {
              while (true)
              {
                if ((this.curChar != '\n') && (this.curChar != '\r'))
                  break label575;
                ++j;
                k = 0;
              }
              str = this.input_stream.GetImage();
            }
            ++k;
          }
          str = this.input_stream.GetImage();
        }
      }
    }
  }

  protected Token jjFillToken()
  {
    String str2;
    Token localToken = Token.newToken(this.jjmatchedKind);
    localToken.kind = this.jjmatchedKind;
    String str1 = jjstrLiteralImages[this.jjmatchedKind];
    if (str1 == null)
      str2 = this.input_stream.GetImage();
    while (true)
    {
      localToken.image = str2;
      localToken.beginLine = this.input_stream.getBeginLine();
      localToken.beginColumn = this.input_stream.getBeginColumn();
      localToken.endLine = this.input_stream.getEndLine();
      localToken.endColumn = this.input_stream.getEndColumn();
      return localToken;
      str2 = str1;
    }
  }

  public void setDebugStream(PrintStream paramPrintStream)
  {
    this.debugStream = paramPrintStream;
  }
}